﻿using Master_Details_view.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Master_Details_view.Controllers
{
    public class AddressBookController : Controller
    {
        private UsersContext db = new UsersContext();
        //
        // GET: /AddressBook/

        public ActionResult Index()
        {
            return View();
        }
        public JsonResult JsonIndex(int? var)
        {
            List<User> users = db.Users.Include("Addresses").ToList();
            return Json(new { Users = users });
        }
    }
}
